﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;   
using WinFormsMvp;
using PresentationLayer.Views.ViewContracts;
using EngineLayer;
using EngineLayer.Services;

namespace PresentationLayer.Presenters
{
        public class MainPresenter : Presenter<IMainView>
        { 
            public MainPresenter(IMainView view)
                : base(view)
            {
                View.CloseFormClicked += View_CloseFormClicked;
                View.DisplayForms += view_DisplayViews;
                View.Load += View_Load;
            }

            private void View_CloseFormClicked(object sender, EventArgs e)
            {
                View.Exit();
            }

            private void View_Load(object sender, EventArgs e)
            {
                View.Model = new MainViewModel();
            }

            private void view_DisplayViews(object sender, EventArgs e)
            {
                View.DisplayView(); 
            }
        }
    }

